package com.pyl.admin.system.validator;

import java.io.Serializable;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Length;

import lombok.Data;

/**
 * @author 灵魂贰婶
 * @date 2018/8/14
 */
@Data
public class UserForm implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@NotBlank(message = "用户名不能为空")
	@Length(max = 5, min = 2, message = "用户名为2-5个字符")
	private String username;

	@NotNull(message = "部门不能为空")
	private Integer dept;

	@NotBlank(message = "用户昵称不能为空")
	@Length(max = 5, min = 2, message = "昵称为2-5个字符")
	private String nickname;

	@Pattern(regexp = "^1[3|4|5|7|8][0-9]\\d{4,8}$", message = "请输入正确的电话号码")
	private String phone;

	@NotBlank(message = "邮箱不能为空")
	@Email(message = "请输入正确的邮箱")
	private String email;

	@NotNull(message = "请选择性别")
	private String sex;

	@Pattern(regexp = "[a-zA-Z0-9\\u4E00-\\u9FA5]*", message = "请输入正确的备注内容,不含特殊符号")
	@Length(max = 150, min = 0, message = "备注最大长度为150")
	private String remark;

	private Long id;

	private String confirm;

	
	@Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,16}$", message = "密码不符合要求必须8-16位之间数字字母组合")
	private String password;

}
